<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<title>title</title>
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
</head>

<body>
	<section class="aui-bg-tag-money">
		<header class="aui-bar aui-bar-nav" id='aui-header'>
			<a class="aui-pull-left aui-btn" tapmode onclick="api.closeWin();"> <span class="aui-iconfont aui-icon-left"></span> </a>
			<div class="aui-title" id="name"></div>
		</header>
		<div style="height:45px"></div>
	</section>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jdpddmenu.js"></script>
<script type="text/javascript">
	var the_one_menulist = [];
	apiready = function() {
		api.parseTapmode();
		var pageParam = api.pageParam.data;
		$api.text($api.byId('name'), pageParam.name);
		var header = $api.byId('aui-header');
		$api.fixStatusBar(header);
		var headerPos = $api.offset(header).h;
		var the_menulist = pageParam.source_type == 'jd' ? JD_MENU : pageParam.source_type == 'pdd' ? PDD_MENU : TB_MENU;
		the_one_menulist[0] = {
			title: '优选',
			bg: 'rgba(0,0,0,0.0)',
			cid: pageParam.parent_id,
			cname: '优选',
			bgSelected: 'widget://image/cate_bg.png'
		};
		for (let i = 0; i < the_menulist.length; i++) {
			if (the_menulist[i].parent_id == pageParam.parent_id) {
				the_menulist[i].title = the_menulist[i].cname;
				the_menulist[i].bg = 'rgba(0,0,0,0.0)';
				the_menulist[i].bgSelected = 'widget://image/cate_bg.png';
				the_one_menulist.push(the_menulist[i]);
			}
		}
		var frame_list = [];
		if (pageParam.parent_id !== 0) {
			setNavMenu('pdd_jd', headerPos, the_one_menulist, {
				width: 100
			});
		} else {
			setNavMenu('pdd_jd', headerPos, the_one_menulist, {
				width: 70
			});
			pageParam.level = 1;
		}
		for (let i = 0; i < the_one_menulist.length; i++) {
			frame_list[i] = {
				name: pageParam.source_type + '_frame_list_' + i,
				url: 'widget://html/index_frames.html',
				pageParam: {
					cid: the_one_menulist[i].cid,
					source_type: pageParam.source_type,
					level: pageParam.level == 1 ? 1 : (pageParam.level == 2 && i == 0 ? 2 : 3)
				},
				bounces: true,
				allowEdit: true,
			}
		}
		api.openFrameGroup({
			name: 'pdd_jd_frame_list',
			scrollEnabled: true,
			rect: {
				marginLeft: 0,
				marginRight: 0,
				marginTop: headerPos + 45,
			},
			fixedOn: 'ui_window',
			index: 0,
			preload: 3,
			frames: frame_list
		}, function(ret, err) {
			setNavMenuSelected('pdd_jd', ret.index);
		});
	};
</script>

</html>
